﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style TargetType="{x:Type Button}">
        <Setter Property="Margin" Value="4"/>
    </Style>
    <Style TargetType="{x:Type ListView}">
        <Setter Property="Margin" Value="4"/>
        <Setter Property="Background" Value="AliceBlue"/>
    </Style>
    <Style TargetType="{x:Type ListViewItem}">
        <Style.Resources>
            <!--SelectedItem with focus-->
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Blue" Opacity=".4"/>
            <!--SelectedItem without focus-->
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Blue" Opacity=".4"/>
        </Style.Resources>
    </Style>
    <Style TargetType="{x:Type StackPanel}">
        <Setter Property="Margin" Value="4"/>
    </Style>
    <Style TargetType="{x:Type TabControl}">
        <Setter Property="Margin" Value="4"/>
    </Style>
    <Style TargetType="{x:Type TreeView}">
        <Setter Property="Margin" Value="4"/>
        <Setter Property="Background" Value="AliceBlue"/>
    </Style>
    <Style TargetType="{x:Type StatusBar}">
        <Setter Property="Margin" Value="4"/>
    </Style>
    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="Margin" Value="4"/>
    </Style>
    <Style TargetType="{x:Type ComboBox}">
        <Setter Property="Margin" Value="4"/>
    </Style>
    <Style TargetType="{x:Type GridSplitter}">
        <Setter Property="Background" Value="DarkGray"/>
        <Setter Property="Margin" Value="4"/>
    </Style>
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Margin" Value="4"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsReadOnly" Value="True"/>
    </Style>
    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="Margin" Value="4"/>
    </Style>
    <!--<Style TargetType="{x:Type Border}">
        <Setter Property="Height" Value="4"/>
        <Setter Property="Background" Value="DarkGray"/>
    </Style>-->
    <Style x:Key="CloseTabButton" TargetType="{x:Type Button}">
        <Style.Resources>
            <SolidColorBrush x:Key="NormalBackgroundBrush" Color="#00000000" />
            <SolidColorBrush x:Key="NormalBorderBrush" Color="#FFFFFFFF" />
            <SolidColorBrush x:Key="NormalForegroundBrush" Color="#FF8f949b" />

            <SolidColorBrush x:Key="HoverBackgroundBrush" Color="#FFc13535" />
            <SolidColorBrush x:Key="HoverForegroundBrush" Color="#FFf9ebeb" />

            <SolidColorBrush x:Key="PressedBackgroundBrush" Color="#FF431e20" />
            <SolidColorBrush x:Key="PressedBorderBrush" Color="#FF110033" />
            <SolidColorBrush x:Key="PressedForegroundBrush" Color="#FFf9ebeb" />
        </Style.Resources>

        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Height" Value="15"/>
        <Setter Property="Width" Value="15"/>
        <Setter Property="Background" Value="Red"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid Background="Transparent">

                        <!-- The background of the button, as an ellipse. -->
                        <Ellipse x:Name="backgroundEllipse"/>

                        <!-- A path that renders a cross. -->
                        <Path x:Name="ButtonPath"
                              Margin="3"
                              Stroke="{StaticResource NormalForegroundBrush}"
                              StrokeThickness="1.5"
                              StrokeStartLineCap="Square"
                              StrokeEndLineCap="Square"
                              Stretch="Uniform"
                              VerticalAlignment="Center"
                              HorizontalAlignment="Center">
                            <Path.Data>
                                <PathGeometry>
                                    <PathGeometry.Figures>
                                        <PathFigure StartPoint="0,0">
                                            <LineSegment Point="25,25"/>
                                        </PathFigure>
                                        <PathFigure StartPoint="0,25">
                                            <LineSegment Point="25,0"/>
                                        </PathFigure>
                                    </PathGeometry.Figures>
                                </PathGeometry>
                            </Path.Data>
                        </Path>
                    </Grid>
                    <!-- The triggers. -->
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="backgroundEllipse" Property="Fill"
                                    Value="{StaticResource HoverBackgroundBrush}"/>
                            <Setter TargetName="ButtonPath" Property="Stroke"
                                    Value="{StaticResource HoverForegroundBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="backgroundEllipse" Property="Fill"
                                    Value="{StaticResource PressedBackgroundBrush}"/>
                            <Setter TargetName="backgroundEllipse" Property="Stroke"
                                    Value="{StaticResource PressedBorderBrush}" />
                            <Setter TargetName="ButtonPath" Property="Stroke" 
                                    Value="{StaticResource PressedForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>